package com.dt76.smallloanbackenduser.remote.etao;

import com.dt76.smallloanbackenduser.hystrix.etao.LoginHystrix;
import com.dt76.smallloanbackenduser.pojo.etao.CurrentUser;
import com.dt76.smallloanbackenduser.pojo.etao.LoginLog;
import com.dt76.smallloanbackenduser.utils.Page;
import com.dt76.smallloanbackenduser.utils.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "smallloan-backend-service",fallback = LoginHystrix.class)
public interface LoginRemote {

    @RequestMapping("/doEmpLogin")
    CurrentUser doLogin(@RequestParam("empLoginName") String empLoginName,
                        @RequestParam("empPasswrod") String empPasswrod);

    @RequestMapping("/addLoginMsg")
    Result addLoginMsg(@RequestBody LoginLog loginLog);

    @RequestMapping("/getLoginLog")
    Page getLogin(@RequestParam("pageNum") Integer pageNum,
                  @RequestParam("empName") String empName,
                  @RequestParam("startTime") String startTime,
                  @RequestParam("endTime") String endTime);

}
